/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package control;

import java.io.IOException;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import model.CargoDAO;
import model.ProfissaoDAO;
import model.ProfissionalCargoDAO;



/**
 *
 * @author Eduarda
 */
public class TrataPreCadastroProfissional extends Comando{

    @Override
    public void executar(HttpServletRequest request, HttpServletResponse response) throws ClassNotFoundException, SQLException, IOException, ServletException {
           
    response.setContentType("text/html;charset=UTF-8");

        ProfissaoDAO pacdao = new ProfissaoDAO();
        CargoDAO profc = new CargoDAO(); 
        
        HttpSession session = request.getSession(false);
        session.setAttribute("listaProfissoes", pacdao.pesquisar());
        
        session.setAttribute("listaCargos", profc.pesquisar());
       //session.setAttribute("listaPacientes", new ArrayList());        
        response.sendRedirect("cadastraProfissional.jsp");
    }
    
}
